package com.algo.Al.common;

/**
 * @Author: guoxing
 * @Email: gx_study2022@163.com
 * @Description:
 * @Date: 2024/6/3 12:44
 * @ClassName: BaseContext
 **/
public class BaseContext {
    //用来存储用户id
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    /**
     * 设置值
     * @param id
     */
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    /**
     * 获取值
     * @return
     */
    public static Long getCurrentId(){
        return threadLocal.get();
    }
}
